/* 
 * File:   globalInit.h
 * Author: ferranferri
 *
 * Created on May 14, 2013, 6:38 PM
 */
#pragma once
#ifndef _Z3D_UTILS_GLOBALINIT_H
#define	_Z3D_UTILS_GLOBALINIT_H

#include <gtest/gtest.h>
#include "Log/LogSystem.h"
#include "utils/cuUtils.h"

class UTILS_Environment : public ::testing::Environment {
public:

    virtual ~UTILS_Environment() {
    }
    // Override this to define how to set up the environment.

    virtual void SetUp() {
        // iniciando sistema de logs.
        glog::CGlobalLog::initSingleton();
        boost::shared_ptr<glog::IListener> lis(new glog::CLogWriter("Log.txt", glog::LOGLEVEL_DEBUG));
        glog::CGlobalLog::getSingleton().addListener(lis, UTILS_APPENDER);
    }
    // Override this to define how to tear down the environment.

    virtual void TearDown() {
        glog::CGlobalLog::getSingleton().processMessages();
        glog::CGlobalLog::destroySingleton();
    }
};

::testing::Environment * const foo_env = ::testing::AddGlobalTestEnvironment(new UTILS_Environment);



#endif	/* _Z3D_UTILS_GLOBALINIT_H */

